{% extends 'layout.html' %}
{% load stark %}

{% block css %}
    <style>
        .comb-search {
            padding: 5px 10px;
        }

        .comb-search .row .whole {
            width: 60px;
            float: left;

        }

        .comb-search .row .others {
            padding-left: 60px;
        }

        .comb-search .row a {
            display: inline-block;
            padding: 5px 8px;
            margin: 3px;
            border: 1px solid #d4d4d4;

        }

        .comb-search .row a {
            display: inline-block;
            padding: 5px 8px;
            margin: 3px;
            border: 1px solid #d4d4d4;
        }

        .comb-search a.active {
            color: #fff;
            background-color: #337ab7;
            border-color: #2e6da4;
        }

        .table > tbody > tr > td {
            vertical-align: middle;
        }
    </style>
{% endblock %}
{% block content %}
    <div>
        {% if cl.list_filter %}
            <div class="panel panel-default">
                <div class="panel-heading"><i class="fa fa-filter" aria-hidden="true"></i> 快速筛选</div>
                <div class="panel-body">
                    <div class="comb-search">
                        {% for row in cl.gen_list_filter_rows %}
                            <div class="row">
                                {% for obj in row %}
                                    {{ obj|safe }}
                                {% endfor %}
                            </div>
                        {% endfor %}
                    </div>
                </div>
            </div>
        {% endif %}


        <div class="panel panel-body panel-default">
            {% if cl.search_list %}
                <div style="float: right;">
                    <form method="GET" class="form-inline">
                        <div class="form-group">
                            <input class="form-control" type="text" name="q" value="{{ cl.q }}" placeholder="关键字搜索">
                            <button class="btn btn-primary" type="submit">
                                <i class="fa fa-search" aria-hidden="true"></i>
                            </button>
                        </div>
                    </form>
                </div>
            {% endif %}
            <form class="form-horizontal form-group-sm" method="post">
                <div style="margin: 5px 0;">
                    {% if cl.add_btn %}
                        {{ cl.add_btn }}
                    {% endif %}

                    {% if cl.list_edit %}
                        <input type="submit" value="保存" class="btn btn-primary" name="_multi_save">
                    {% endif %}
                </div>
                {% csrf_token %}
                {{ cl.model_formset.management_form }}
                {% if cl.action_list %}
                    <div style="width: 500px;margin-left: 15px;">
                        <div class="form-group">
                            <select name="action" class="form-control" style="width: 200px;display: inline-block">
                                <option>请选择功能</option>
                                {% for item in cl.action_list %}
                                    <option value="{{ item.name }}">{{ item.text }}</option>
                                {% endfor %}
                            </select>
                            <input class="btn btn-primary" type="submit" value="执行" name="_action">
                        </div>
                    </div>
                {% endif %}

                {% table cl %}

                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        {{ cl.page.page_html|safe }}
                    </ul>
                </nav>
            </form>
        </div>

    </div>



{% endblock %}

{% block js %}

{% endblock %}